package com.markchu.admin.web;

import org.apache.commons.dbutils.DbUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.MapListHandler;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public class OracleUtils {
    public static void main(String[] args) throws ClassNotFoundException {
            // 定义数据库连接信息
            String url = "jdbc:mysql://127.0.0.1:27860/timo";
            String username = "root";
            String password = "suggie8611";

            Connection conn = null;
            try {
                // 创建数据库连接
                Class.forName("oracle.jdbc.driver.OracleDriver");
                conn = DriverManager.getConnection(url, username, password);

                // 创建 QueryRunner 对象
                QueryRunner queryRunner = new QueryRunner();
                // 将数据插入到数据库中
                List<Map<String, Object>> dataMapList = queryRunner.query(conn,"select * from timo.web_hospital where new_thums is null",new MapListHandler());


            } catch (SQLException e) {
                e.printStackTrace();
            } finally {
                // 关闭数据库连接
                DbUtils.closeQuietly(conn);
            }
    }
}
